package com.kamikaze;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.catalina.Session;

public class ShiftServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    public ShiftServlet() {super();}
    
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		HttpSession session = request.getSession();
		String user_id = request.getParameter("user_id");
		String date_begin = request.getParameter("date_begin");
		String date_end = request.getParameter("date_end");
		Shift shift = (Shift) session.getAttribute("shift");
		shift.setUser_id(user_id);
		shift.setDate_begin(date_begin);
		shift.setDate_end(date_end);
		session.setAttribute("shift", shift);
		response.sendRedirect("index.jsp?f=3");
	}
}